ui: pass validated storagepolicy for swift store#11315
ui: pass validated storagepolicy for swift store#11315sureshanaparti merged 1 commit intoapache:4.19from
Conversation
Fixes apache#9789 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.19 #11315 +/- ##
=========================================
Coverage 15.17% 15.18%
- Complexity 11362 11368 +6
=========================================
Files 5415 5415
Lines 476030 476032 +2
Branches 58115 58116 +1
=========================================
+ Hits 72246 72263 +17
+ Misses 395701 395683 -18
- Partials 8083 8086 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Fixes a bug in the Swift storage configuration by adding validation before passing the storagepolicy parameter. The change prevents passing an empty or undefined storagepolicy value to the Swift store configuration.
- Adds conditional validation for the storagepolicy parameter before including it in swiftParams
- Prevents potential issues with empty or undefined storagepolicy values being sent to the backend
|
@blueorangutan pacakge |
1 similar comment
|
@blueorangutan pacakge |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14472 |
kiranchavala
left a comment
There was a problem hiding this comment.
@shwstppr not a UI issue i believe
When there is no zone id provided to
https://cloudstack.apache.org/api/apidocs-4.20/apis/addImageStore.html
add imagestore provider=Swift name=gh2 details[0].key=account details[0].value=AUTH_test details[1].key=username details[1].value=test:tester details[2].key=key details[2].value=testing url=http://127.0.0.1:8081
🙈 Error: (HTTP 530, error code 9999) <nil>
Logs
2025-07-31 05:31:30,141 DEBUG [c.c.a.ApiServlet] (qtp146370526-19:ctx-25745abc) (logid:cfa196bb) ===START=== 10.0.33.30 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=addImageStore&details[0].key=account&details[0].value=AUTH_test&details[1].key=username&details[1].value=test%3Atester&details[2].key=key&details[2].value=testing&name=gh2&provider=Swift&response=json&url=http%3A%2F%2F127.0.0.1%3A8081&signature=VUVzkNEKIHfBWnYEOM8ERNkdT%2FA%3D
2025-07-31 05:31:30,148 DEBUG [c.c.a.ApiServer] (qtp146370526-19:ctx-25745abc ctx-cadf6c05) (logid:cfa196bb) CIDRs from which account 'Account [{"accountName":"admin","id":2,"uuid":"12e6ae5d-6dba-11f0-8c3a-1e001e0001b1"}]' is allowed to perform API calls: 0.0.0.0/0,::/0
2025-07-31 05:31:30,154 DEBUG [o.a.c.a.StaticRoleBasedAPIAccessChecker] (qtp146370526-19:ctx-25745abc ctx-cadf6c05) (logid:cfa196bb) RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.
2025-07-31 05:31:30,156 DEBUG [o.a.c.r.ApiRateLimitServiceImpl] (qtp146370526-19:ctx-25745abc ctx-cadf6c05) (logid:cfa196bb) API rate limiting is disabled. We will not use ApiRateLimitService.
2025-07-31 05:31:30,158 INFO [o.a.c.s.d.l.SwiftImageStoreLifeCycleImpl] (qtp146370526-19:ctx-25745abc ctx-cadf6c05 ctx-895fd978) (logid:cfa196bb) Trying to add a swift store at http://127.0.0.1:8081 in data center null
2025-07-31 05:31:30,197 DEBUG [o.a.c.s.i.TemplateDataFactoryImpl] (qtp146370526-19:ctx-25745abc ctx-cadf6c05 ctx-895fd978) (logid:cfa196bb) template 3 is already in store:6, type:Image
2025-07-31 05:31:30,207 DEBUG [o.a.c.s.c.a.StorageCacheRandomAllocator] (qtp146370526-19:ctx-25745abc ctx-cadf6c05 ctx-895fd978) (logid:cfa196bb) Can't find staging storage in zone: null
2025-07-31 05:31:30,211 ERROR [c.c.a.ApiServer] (qtp146370526-19:ctx-25745abc ctx-cadf6c05 ctx-895fd978) (logid:cfa196bb) unhandled exception executing api command: [Ljava.lang.String;@5b26c5a2
java.lang.NullPointerException
at org.apache.cloudstack.storage.datastore.driver.SwiftImageStoreDriverImpl.createAsync(SwiftImageStoreDriverImpl.java:107)
at org.apache.cloudstack.storage.image.TemplateServiceImpl.createTemplateAsync(TemplateServiceImpl.java:202)
at org.apache.cloudstack.storage.image.TemplateServiceImpl.downloadBootstrapSysTemplate(TemplateServiceImpl.java:247)
at com.cloud.storage.StorageManagerImpl.discoverImageStore(StorageManagerImpl.java:3399)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
When there is zone id provided
(localcloud) 🐱 > add imagestore provider=Swift name=gh2 details[0].key=account details[0].value=AUTH_test details[1].key=username details[1].value=test:tester details[2].key=key details[2].value=testing url=http://127.0.0.1:8081 zoneid=4e4b9342-fdb6-410f-bc8d-25a107d6a3f6
🙈 Error: (HTTP 431, error code 4350) Image store provider Swift does not support scope ZONE
https://cloudstack.apache.org/api/apidocs-4.20/apis/addSwift.html
(localcloud) 🐱 > add swift url=http://127.0.0.1:8081 username=test:tester account=AUTH_test key=testing
🙈 Error: (HTTP 530, error code 9999) <nil>
2025-07-31 05:33:41,290 DEBUG [c.c.a.ApiServlet] (qtp146370526-18:ctx-7deaced8) (logid:692bcccd) ===START=== 10.0.33.30 -- GET account=AUTH_test&apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=addSwift&key=testing&response=json&url=http%3A%2F%2F127.0.0.1%3A8081&username=test%3Atester&signature=98SLp9zuj9OL1WneGTib4S6w93o%3D
2025-07-31 05:33:41,295 DEBUG [c.c.a.ApiServer] (qtp146370526-18:ctx-7deaced8 ctx-df31b325) (logid:692bcccd) CIDRs from which account 'Account [{"accountName":"admin","id":2,"uuid":"12e6ae5d-6dba-11f0-8c3a-1e001e0001b1"}]' is allowed to perform API calls: 0.0.0.0/0,::/0
2025-07-31 05:33:41,300 DEBUG [o.a.c.a.StaticRoleBasedAPIAccessChecker] (qtp146370526-18:ctx-7deaced8 ctx-df31b325) (logid:692bcccd) RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.
2025-07-31 05:33:41,300 DEBUG [o.a.c.r.ApiRateLimitServiceImpl] (qtp146370526-18:ctx-7deaced8 ctx-df31b325) (logid:692bcccd) API rate limiting is disabled. We will not use ApiRateLimitService.
2025-07-31 05:33:41,314 INFO [o.a.c.s.d.l.SwiftImageStoreLifeCycleImpl] (qtp146370526-18:ctx-7deaced8 ctx-df31b325 ctx-e43d5512) (logid:692bcccd) Trying to add a swift store at http://127.0.0.1:8081 in data center null
2025-07-31 05:33:41,344 DEBUG [o.a.c.s.i.TemplateDataFactoryImpl] (qtp146370526-18:ctx-7deaced8 ctx-df31b325 ctx-e43d5512) (logid:692bcccd) template 3 is already in store:6, type:Image
2025-07-31 05:33:41,356 DEBUG [o.a.c.s.i.TemplateDataFactoryImpl] (qtp146370526-18:ctx-7deaced8 ctx-df31b325 ctx-e43d5512) (logid:692bcccd) template 3 is already in store:7, type:Image
2025-07-31 05:33:41,369 DEBUG [o.a.c.s.c.a.StorageCacheRandomAllocator] (qtp146370526-18:ctx-7deaced8 ctx-df31b325 ctx-e43d5512) (logid:692bcccd) Can't find staging storage in zone: null
2025-07-31 05:33:41,375 ERROR [c.c.a.ApiServer] (qtp146370526-18:ctx-7deaced8 ctx-df31b325 ctx-e43d5512) (logid:692bcccd) unhandled exception executing api command: [Ljava.lang.String;@4d138f1d
java.lang.NullPointerException
at org.apache.cloudstack.storage.datastore.driver.SwiftImageStoreDriverImpl.createAsync(SwiftImageStoreDriverImpl.java:107)
at org.apache.cloudstack.storage.image.TemplateServiceImpl.createTemplateAsync(TemplateServiceImpl.java:202)
at org.apache.cloudstack.storage.image.TemplateServiceImpl.downloadBootstrapSysTemplate(TemplateServiceImpl.java:247)
at com.cloud.storage.StorageManagerImpl.discoverImageStore(StorageManagerImpl.java:3399)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy108.discoverImageStore(Unknown Source)
at org.apache.cloudstack.api.command.admin.swift.AddSwiftCmd.execute(AddSwiftCm
Fixes apache#11315 (review) Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@kiranchavala The error logs shared suggest a different issue than the one originally reported. |
Thanks @shwstppr will test the fix |
Fixes #11315 (review) Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Fixes apache#11315 (review) Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Fixes apache#9789 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Description
Fixes #9789
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?